﻿@model IEnumerable<WebUI.Models.QizSubject>
@{ViewBag.Title = "现有常规随访";}
<p>
    <div class="toolbox">
        <div class="catalog-title">
            现有常规随访</div>
    </div>
    <style>
        .num{text-align:right;}
    </style>
    <table class="width" cellpadding="0" cellspacing="0">
        <tr>
            <th>
                常规随访名称
            </th>
            <th>
                备注说明
            </th>
            <th>
                当前状态
            </th>
            <th>
                定义日期
            </th>
            <th>
                发起人数
            </th>
            <th>
                参加人数
            </th>
            <th>
                填报次数
            </th>
            <th>
                操作
            </th>
        </tr>
        @{int dColor = 0;}
        @foreach (var item in Model.Where(v => v.StatusID != "104").OrderByDescending(v => v.SortIdx))
        {
            <tr class="tr-backColor@(dColor++ % 2)">
                <td>
                    @Html.DisplayFor(modelItem => item.Title)
                </td>
                <td title="@item.DescForDoctor">
                    @Html.FixStrSuffix(item.DescForDoctor, 16)
                </td>
                <td>
                    @Html.DisplayFor(m => item.StatusRef.OptionTitle)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.CreateTime)
                </td>
                @if (item.StatusID == "100")
                {                  
                    <td class="num">@item.QizSubjectObjForDoctors.Where(v=> !v.Recuper.GuoQi ).Select(v => v.Recuper.UserID).Distinct().Count()人</td>
                    <td class="num">@item.QizSessions.Select(v => v.UserID).Distinct().Count() 人</td>
                    <td class="num">@item.QizSessions.Count() 人/次</td>
                    <td>
                        @Html.ActionLink("预览", "QizSessionEdit", new { SubjectID = item.ID, PreviewOnly = true, _newpage = "true" }, new { Target = "_blank" })
                        |
                        @Ajax.ActionLink("添加随访对象", "SubjectRecuperList", new { SubjectID = item.ID, IsContain = false }, new AjaxOptions() { LoadingElementId = "OnLoadingSpan", UpdateTargetId = "recuperlist", InsertionMode = InsertionMode.Replace, OnFailure = "OnSiteError" })
                        |
                        @Ajax.ActionLink("随访对象浏览", "SubjectRecuperList", new { SubjectID = item.ID, IsContain = true }, new AjaxOptions() { LoadingElementId = "OnLoadingSpan", UpdateTargetId = "recuperlist", InsertionMode = InsertionMode.Replace, OnFailure = "OnSiteError" })
                    </td>}
                else
                {
                        
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                }
            </tr>
        }
    </table>
</p>
<p>
    <div id="recuperlist">
    </div>
</p>
@Html.Partial("TrHilighter")
